﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestTasks.Cataloguer
{
    public class ListCatalogue : ICatalogue
    {
        readonly List<IDocument> docs;
        
        public ListCatalogue()
        { 
            docs = new List<IDocument>();
        }

        public void Add(IDocument document)
        {
            docs.Add(document);
        }

        public void Sort(IComparer<IDocument> comparer)
        {
            docs.Sort(comparer);
        }

        public IEnumerator<IDocument> GetEnumerator()
        {
            return docs.GetEnumerator();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return docs.GetEnumerator();
        }
    }
}
